bitkeeper revision 1.1010.1.3 (40db2385Aq2phajZDogkMkJtQna8qA)
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Thu, 24 Jun 2004 18:55:01 +0000 (18:55 +0000)
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Thu, 24 Jun 2004 18:55:01 +0000 (18:55 +0000)
Some small help fixes.

tools/xenmgr/lib/xm/main.py
tools/xenmgr/lib/xm/shutdown.py

index 86f606fd83903ebf34106466cccb417229efcd5c..09b658d8504cb86546e2a80042ed41f0ceeab41a 100644 (file)
@@ -127,7 +127,7 @@ class ProgHelp(Prog):
             name = args[1]
             p = self.xm.getprog(name)
             if p:
-                p.help(args)
+                p.help(args[1:])
             else:
                 print '%s: Unknown command: %s' % (self.name, name)
         else:
@@ -159,22 +159,13 @@ class ProgSave(Prog):
     info = """Save domain state (and config) to file."""
 
     def help(self, args):
-        print args[0], "DOM FILE [CONFIG]"
-        print """\nSave domain with id DOM to FILE.
-        Optionally save config to CONFIG."""
+        print args[0], "DOM FILE"
+        print """\nSave domain with id DOM to FILE."""
         
     def main(self, args):
         if len(args) < 3: self.err("%s: Missing arguments" % args[0])
         dom = args[1]
         savefile = os.path.abspath(args[2])
-        configfile = None
-        if len(args) == 4:
-            configfile = os.path.abspath(args[3])
-        if configfile:
-            out = file(configfile, 'w')
-            config = server.xend_domain(dom)
-            PrettyPrint.prettyprint(config, out=out)
-            out.close()
         server.xend_domain_save(dom, savefile)
 
 xm.prog(ProgSave)
@@ -185,13 +176,16 @@ class ProgRestore(Prog):
     info = """Create a domain from a saved state."""
 
     def help(self, args):
-        print args[0], "FILE CONFIG"
+        print args[0], "FILE [CONFIG]"
         print "\nRestore a domain from FILE using configuration CONFIG."
     
     def main(self, help, args):
-        if len(args) < 3: self.err("%s: Missing arguments" % args[0])
+        if len(args) < 2: self.err("%s: Missing arguments" % args[0])
         savefile =  os.path.abspath(args[1])
-        configfile = os.path.abspath(args[2])
+        if len(args) >= 3:
+            configfile = os.path.abspath(args[2])
+        else:
+            configfile = None
         info = server.xend_domain_restore(savefile, configfile)
         PrettyPrint.prettyprint(info)
 
index 7cdcc6310596bfa36cb28bba49c679b9013126b3..50d98bec5e0b86c4a7d78b460414c9b19a64f60b 100644 (file)
@@ -64,7 +64,7 @@ def main_dom(opts, args):
 def main(argv):
     opts = gopts
     args = opts.parse(argv)
-    if opts.help:
+    if opts.vals.help:
         opts.usage()
         return
     print 'shutdown.main>', len(args), args